/* 
*/ 

#ifndef CACHED_OBJ_H
#define CACHED_OBJ_H
#include <cstddef>

template <class T> class CachedObj {
public:
    void *operator new(std::size_t);
    void operator delete(void *, std::size_t);
    virtual ~CachedObj() { }
    void operator delete[](void *, std::size_t);
    void *operator new[](std::size_t);
protected:
    T *next;
private:
    static void add_to_freelist(T*);
    static std::allocator<T> alloc_mem;
    static T *freeStore;
    static const std::size_t chunk;
};

#include "CachedObj.cc"  // inclusion compilation model

#endif
